// 查找指定城市
export function bestFn(data, findCode = "name", key = "name") {
  let findUser = null;

  const Fn = (data) => {
    data.forEach((item) => {
      if (item[key].includes(findCode)) {
        findUser = item;
      }
      if (item.children && item.children.length !== 0) {
        Fn(item.children);
      }
    });
  };
  Fn(data);
  return findUser;
}
